package com.ddyx.rest;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ddyx.util.RequestForm;
import com.ddyx.service.IGoodsService;
import com.ddyx.util.ResponseForm;
/**
 * @ClassName:  GoodsController
 * @Description: 店员端商品管理
 * 
 * @author JiangShuai
 * @date: 2017年12月19日 上午10:39:04
 * @version V1.0  
 * @Copyright: 2017 叮当一下(北京)信息技术有限公司 Inc. All rights reserved.
 * 注意：本内容仅限于叮当一下(北京)信息技术有限公司内部传阅，禁止外泄以及用于其他的商业目
 */
@Controller
@RequestMapping("/goods")
public class GoodsController {
	
	@Resource
	IGoodsService goodsService;
	
	/**
	 * @Title: addGoodsBysSalesclerk   
	 * @Description: 添加商品 
	 * @param: @param param
	 * @param: @return      
	 * @return: ResponseForm      
	 * @throws
	 */
	@ResponseBody
	@RequestMapping(value="addGoodsBysSalesclerk",method=RequestMethod.POST)
	public ResponseForm addGoodsBysSalesclerk(@RequestBody RequestForm param) {
		return goodsService.addGoodsBysSalesclerk(param);
	}
	
	/**
	 * @Title: selectGoodsListBysSalesclerk   
	 * @Description: 店员查商品list 
	 * @param: @param param
	 * @param: @return
	 * @param: @throws Exception      
	 * @return: ResponseForm      
	 * @throws
	 */
	@ResponseBody
	@RequestMapping(value="selectGoodsListBysSalesclerk",method=RequestMethod.POST)
	public ResponseForm selectGoodsListBysSalesclerk(@RequestBody RequestForm param) {
		return goodsService.selectGoodsListBysSalesclerk(param);
	}
	
	/**
	 * @Title: deleteGoodsBysSalesclerk   
	 * @Description: 删除商品  
	 * @author: JiangShuai
	 * @param: @param param
	 * @param: @return      
	 * @return: ResponseForm
	 */
	@ResponseBody
	@RequestMapping(value="deleteGoodsBysSalesclerk",method=RequestMethod.POST)
	public ResponseForm deleteGoodsBysSalesclerk(@RequestBody RequestForm param) {
		return goodsService.deleteGoodsBysSalesclerk(param);
	}
	
	/**
	 * @Title: updateGoodsBysSalesclerk   
	 * @Description: 修改商品  
	 * @author: JiangShuai
	 * @param: @param param
	 * @param: @return      
	 * @return: ResponseForm
	 */
	@ResponseBody
	@RequestMapping(value="updateGoodsBysSalesclerk",method=RequestMethod.POST)
	public ResponseForm updateGoodsBysSalesclerk(@RequestBody RequestForm param) {
		return goodsService.updateGoodsBysSalesclerk(param);
	}
	
	
	/**
	 * @Title: getHotGoods   
	 * @Description: 获取最热商品列表  
	 * @author: lhj
	 * @param: @param param
	 * @param: @return      
	 * @return: ResponseForm
	 */
	@ResponseBody
	@RequestMapping(value = "getHotGoods", method=RequestMethod.POST)
	public ResponseForm getHotGoods(@RequestBody RequestForm param) {
		return goodsService.getHotGoods(param);
	}
	
	/**
	 * @Title: getNewGoods   
	 * @Description: 获取最新商品列表 
	 * @author: lhj
	 * @param: @param param
	 * @param: @return      
	 * @return: ResponseForm
	 */
	@ResponseBody
	@RequestMapping(value="getNewGoods",method=RequestMethod.POST)
	public ResponseForm getNewGoods(@RequestBody RequestForm param) {
		return goodsService.getNewGoods(param);
		
	}

	/**
	 * @Title: getCommendGoods
	 * @Description: 获取店长推荐商品列表
	 * @author: lhj
	 * @param: @param param
	 * @param: @return
	 * @return: ResponseForm
	 */
	@ResponseBody
	@RequestMapping(value="getCommendGoods",method=RequestMethod.POST)
	public ResponseForm getCommendGoods(@RequestBody RequestForm param) {
		return goodsService.getCommendGoods(param);
	}
	
	/**
	 * @Title: getDisCountGoods
	 * @Description: 获取店长推荐商品列表
	 * @author: lhj
	 * @param: @param param
	 * @param: @return
	 * @return: ResponseForm
	 */
	@ResponseBody
	@RequestMapping(value="getDiscountGoods" ,method=RequestMethod.POST)
	public ResponseForm getDiscountGoods(@RequestBody RequestForm param) {
		return goodsService.getDiscountGoods(param);
	}
	
	
	/**
	 * @Title: getFindGoods
	 * @Description: 获取发现商品列表
	 * @author: wush
	 * @param: @param param
	 * @param: @return
	 * @return: ResponseForm
	 */
	@ResponseBody
	@RequestMapping(value="getFindGoods" ,method=RequestMethod.POST)
	public ResponseForm getFindGoods(@RequestBody RequestForm param) {
		return goodsService.getFindGoods(param);
	}
	
	
	/**
	 * @Title: updateGoodsStatus
	 * @Description: 批量修改商品状态（上架、下架、推荐、最新）
	 * @author: wush
	 * @param: @param param
	 * @param: @return
	 * @return: ResponseForm
	 */
	@ResponseBody
	@RequestMapping(value="updateGoodsStatus" ,method=RequestMethod.POST)
	public ResponseForm updateGoodsStatus(@RequestBody RequestForm param) {
		return goodsService.updateGoodsStatus(param);
	}
	
	/**
	 * @Title: getGoodInfo
	 * @Description: 根据商品id获取商品详情
	 * @author: lhj
	 * @param: @param param
	 * @param: @return
	 * @return: ResponseForm
	 */
	@ResponseBody
	@RequestMapping(value="getGoodInfo" ,method=RequestMethod.POST)
	public ResponseForm getGoodInfo(@RequestBody RequestForm param) {
		return goodsService.getGoodInfo(param);
	}
	
	/**
	 * @Title: getGoodsListByTag
	 * @Description: 根据tag标签获取商品列表
	 * @author: lhj
	 * @param param
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="getGoodsListByTag",method=RequestMethod.POST)
	public ResponseForm getGoodsListByTag(@RequestBody RequestForm param) {
		return goodsService.getGoodsListByTag(param);
	}
	
	
	/**
	 * @Title: getGoodDetail
	 * @Description: 支付版-v1.5根据商品id获取商品详情
	 * @return: ResponseForm
	 */
	@ResponseBody
	@RequestMapping(value="/v1.5/getGoodDetail" ,method=RequestMethod.POST)
	public ResponseForm getGoodDetail(@RequestBody RequestForm param) {
		return goodsService.getGoodDetail(param);
	}
	
	/**
	 * @Title: addgoods
	 * @Description: 支付版-v1.5新增商品
	 * @return: ResponseForm
	 */
	@ResponseBody
	@RequestMapping(value="/v1.5/addGoods" ,method=RequestMethod.POST)
	public ResponseForm addGoods(@RequestBody RequestForm param) {
		return goodsService.addGoods(param);
	}

	/**
	 * @Description  支付版-v1.5新增商品
	 * @param param
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "/v1.5/updateGoods", method = RequestMethod.POST)
	public ResponseForm updateGoods(@RequestBody RequestForm param) {
		return goodsService.updateGoods(param);
	}
}
